
sols = []
for p in range(10, 1000):
    sol = 0  
    for a in range(1, p / 3):
        for b in range(a, (p - a) / 2):
            c = p - a - b
            if a * a + b * b == c * c:
                sol += 1 
    if sol != 0:
        sols += [(sol, p)]

print max(sols)[1]

